/* index.css - 主样式文件 */

/* ===== 基础重置与变量定义 ===== */
:root {
    /* 间距系统 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* 颜色系统 - 亮色主题 */
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-secondary: #00a86b;
    --color-accent: #ff6b00;
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-text-lighter: #94a3b8;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    
    /* 过渡效果 */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-inner: inset 0 2px 4px 0 rgba(0,0,0,0.05);
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* 排版 */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --line-height-normal: 1.6;
    --line-height-heading: 1.2;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;
    --font-size-4xl: 3rem;
}

/* 暗黑主题变量 */
[data-theme="dark"] {
    --color-primary: #3b82f6;
    --color-primary-dark: #2563eb;
    --color-secondary: #10b981;
    --color-accent: #f59e0b;
    --color-text: #e2e8f0;
    --color-text-light: #94a3b8;
    --color-text-lighter: #64748b;
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-border: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
}

/* 基础重置 */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* 排版 */
h1, h2, h3, h4, h5, h6 {
    line-height: var(--line-height-heading);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: var(--font-size-3xl);
}

h2 {
    font-size: var(--font-size-2xl);
}

h3 {
    font-size: var(--font-size-xl);
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-base);
    line-height: 1;
    cursor: pointer;
    transition: 
        background-color var(--transition-fast), 
        border-color var(--transition-fast),
        transform var(--transition-fast);
    border: 1px solid transparent;
    user-select: none;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background-color: var(--color-primary);
    color: white;
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
    color: white;
}

.btn--secondary {
    background-color: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

.btn--secondary:hover {
    background-color: var(--color-bg);
    color: var(--color-primary-dark);
}

/* 头部 */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-surface);
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo__text {
    position: relative;
    padding: var(--spacing-xs) var(--spacing-sm);
}

.logo__text::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-primary);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.logo:hover .logo__text::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* 导航 */
.nav__list {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
}

.nav__link {
    position: relative;
    color: var(--color-text-light);
    font-weight: 500;
    padding: var(--spacing-sm) 0;
}

.nav__link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav__link:hover,
.nav__link--active {
    color: var(--color-text);
}

.nav__link:hover::after,
.nav__link--active::after {
    width: 100%;
}

/* 主题切换按钮 */
.theme-toggle {
    background: none;
    border: none;
    padding: var(--spacing-sm);
    cursor: pointer;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
    transition: background-color var(--transition-fast);
}

.theme-toggle:hover {
    background-color: var(--color-surface);
}

.theme-toggle__icon {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
}

.sun-icon,
.moon-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun-icon::before,
.sun-icon::after,
.moon-icon::before {
    content: "";
    position: absolute;
    background-color: var(--color-text);
    border-radius: var(--radius-full);
    transition: background-color var(--transition-base);
}

/* 太阳图标 */
.sun-icon::before {
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    background-color: var(--color-text);
}

.sun-icon::after {
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-text);
    border-radius: var(--radius-full);
    transform: translate(-50%, -50%);
    opacity: 0;
}

/* 月亮图标 */
.moon-icon::before {
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    box-shadow: 4px -4px 0 0 var(--color-text);
    transform: translate(-50%, -50%);
}

/* 暗黑模式下的图标状态 */
[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0);
}

[data-theme="light"] .sun-icon {
    opacity: 1;
    transform: rotate(0);
}

[data-theme="light"] .moon-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

/* 移动菜单切换按钮 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: var(--spacing-sm);
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    z-index: 110;
}

.mobile-menu-toggle__line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-text);
    border-radius: var(--radius-sm);
    transition: 
        transform var(--transition-base),
        opacity var(--transition-base);
}

/* 主内容区域 */
.main {
    padding: var(--spacing-xl) 0;
}

/* 英雄区域 */
.hero {
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(135deg, var(--color-surface), var(--color-bg));
    border-bottom: 1px solid var(--color-border);
}

.hero__content {
    max-width: 700px;
}

.hero__title {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
    line-height: 1.1;
}

.hero__subtitle {
    font-size: var(--font-size-xl);
    color: var(--color-text-light);
    margin-bottom: var(--spacing-xl);
}

.hero__actions {
    display: flex;
    gap: var(--spacing-md);
}

/* 区域标题 */
.section {
    padding: var(--spacing-2xl) 0;
}

.section__header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section__title {
    font-size: var(--font-size-2xl);
    position: relative;
    display: inline-block;
    margin-bottom: var(--spacing-sm);
}

.section__title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: var(--radius-full);
}

.section__subtitle {
    color: var(--color-text-light);
    font-size: var(--font-size-lg);
}

/* 特性网格 */
.features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
}

.feature {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    border: 1px solid var(--color-border);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature__icon {
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: center;
}

.icon-box {
    width: 70px;
    height: 70px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-base);
}

.feature:hover .icon-box {
    background-color: rgba(37, 99, 235, 0.2);
}

.icon-box__inner {
    width: 40px;
    height: 40px;
    background-color: var(--color-primary);
    border-radius: var(--radius-md);
    position: relative;
}

.icon-box__inner::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
}

.feature__title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
}

.feature__description {
    color: var(--color-text-light);
}

/* 标签页组件 */
.tabs {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.tabs__nav {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-bg);
}

.tabs__btn {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-light);
    transition: 
        color var(--transition-fast),
        background-color var(--transition-fast);
    position: relative;
}

.tabs__btn::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tabs__btn:hover {
    color: var(--color-text);
}

.tabs__btn--active {
    color: var(--color-primary);
}

.tabs__btn--active::after {
    transform: scaleX(1);
}

.tabs__content {
    padding: var(--spacing-xl);
}

.tabs__pane {
    display: none;
}

.tabs__pane--active {
    display: block;
}

.code-block {
    display: block;
    background-color: var(--color-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    border: 1px solid var(--color-border);
}

/* 服务网格 */
.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.service-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    border: 1px solid var(--color-border);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.service-card__icon {
    margin-bottom: var(--spacing-md);
    display: flex;
    justify-content: center;
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(37, 99, 235, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: background-color var(--transition-base);
}

.service-card:hover .icon-circle {
    background-color: rgba(37, 99, 235, 0.2);
}

.icon-circle__inner {
    width: 50px;
    height: 50px;
    background-color: var(--color-primary);
    border-radius: 50%;
    position: relative;
}

.icon-circle__inner::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 15px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
}

.service-card__title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
}

.service-card__description {
    color: var(--color-text-light);
    font-size: var(--font-size-base);
}

/* 页脚 */
.footer {
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-2xl) 0 var(--spacing-xl);
    color: var(--color-text-light);
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
}

.footer__info {
    max-width: 350px;
}

.footer-logo {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    display: inline-block;
}

.footer__description {
    margin-bottom: var(--spacing-md);
}

.footer__title {
    font-size: var(--font-size-lg);
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.footer__title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--color-primary);
    border-radius: var(--radius-full);
}

.footer__list {
    list-style: none;
}

.footer__item {
    margin-bottom: var(--spacing-sm);
}

.footer__link {
    color: var(--color-text-light);
    transition: color var(--transition-fast);
}

.footer__link:hover {
    color: var(--color-primary);
}

.footer__bottom {
    border-top: 1px solid var(--color-border);
    padding-top: var(--spacing-lg);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.footer__legal {
    display: flex;
    gap: var(--spacing-md);
}

.footer__legal-link {
    color: var(--color-text-light);
    transition: color var(--transition-fast);
}

.footer__legal-link:hover {
    color: var(--color-primary);
}